package config

import "errors"

const (
	DefaultBegainHour      = 4               // 默认起始时间点 4点
	DefaultCronTime        = "0 0 0 1 * *"   // 默认定时器执行时间
	WeixinAccess_tokenTime = "0 0 */2 * * *" //微信access_token更新时间  2h

	LogMessage = "git.bingyan.net/Foreverxxh/Forumpost/controller"

	CommentDeleteStatus   = 10
	CommentCommonStatus   = 5
	ForumPostDeleteStatus = 10
	ForumPostCommonStatus = 5
	ReplyDeleteStatus     = 10
	ReplyCommonStatus     = 5
	MessageReadStatus     = 5
	MessageNewStatus      = 10
	ApplicationReadStatus = 5
	ApplicationNewStatus  = 10

	//score
	CommentScore = 1000
	ReplyScore   = 200
	StarScore    = 100
	TipoffScore  = 2000
	ShareScore   = 500

	DayDepreciation = 10

	TagScoreOne   = 1000
	TagScoreTwo   = 2000
	TagScoreThree = 3000
	TagScoreFour  = 4000
	TagScoreFive  = 5000
	TagScoreSix   = 6000

	TagOne   = "失物招领"
	TagTwo   = "求助提问"
	TagThree = "征友捞人"
	TagFour  = "吐槽倾诉"
	TagFive  = "表白墙"
	TagSix   = "二手交易"

	ErrorMsgParamWrong = "param wrong"
	ErrorContent       = "内容不能为空"
	//admin
	Hasnotpower              = "Hasnot Power"
	ErrorApplicationGet      = "Get Application False"
	ErrorForumpostTypeChange = "Change Forumpost Type False"
	ErrorApplicationRead     = "Read Application False"
	ErrorAdminInfo           = "用户名或者密码错误"
	ErrorAdminCreat          = "Creat Admin Fasle"

	//err
	ErrorForumpostCreat   = "Creat Forumpost False"
	ErrorCommentCreat     = "Creat Comment False"
	ErrorReplyCreat       = "Creat Reply False"
	ErrorUserCreat        = "Creat User False"
	ErrorApplicationCreat = "Creat Application False"
	ErrorMessageCreat     = "Creat Message False"
	ErrorMessageDelete    = "Delete Message False"

	ErrorReplyGet           = "Get Reply False"
	ErrorCommentGet         = "Get Comment False"
	ErrorForumpostGet       = "Get Forumpost False"
	ErrorForumpostGetByType = "Get Forumpost By Type False"
	ErrorForumpostGetByTags = "Get Forumpost By Tags False"
	ErrorForumpostGetByKey  = "Get Forumpost By Key False"
	ErrorMessageGet         = "Get Message False"

	ErrorCommentStar   = "Star Comment False"
	ErrorForumpostStar = "Star Forumpost False"

	ErrorForumpostDelete    = "Delete Forumpost False"
	ErrorCommentDelete      = "Delete Comment False"
	ErrorReplyDelete        = "Delete Reply False"
	ErrorUserCommentsDelete = "Delete User_Comment False"

	ErrorUserCommentsAdd      = "Add User_Comment False"
	ErrorForumpostChange      = "Change Forumpost False"
	ErrorUpdateForumpostScore = "Update Forumpost Score False"
	ErrorUpdateCommentScore   = "Update Comment Score False"
	ErrorUpdateCommentReply   = "Update Comment_Reply False"
	ErrorUpdateForumpostReply = "Update Forumpost_Reply False"
	ErrorChangeUser           = "Change User False"

	ErrorRecommendForumpost = "Recommend Forumpost False"

	ErrorLogin  = "Login False"
	HasnotToken = "Hasnot Token"

	WechatSessionURIPrefix = "https://api.weixin.qq.com/sns/jscode2session"
	WechatTokenURIPrefix   = "https://api.weixin.qq.com/cgi-bin/token"
	WechatOpenUserInfo     = "https://api.weixin.qq.com/sns/userinfo"
	WeixinMsgSecCheckURI   = "https://api.weixin.qq.com/wxa/msg_sec_check"
	WeixinImgSecCheckURI   = "https://api.weixin.qq.com/wxa/img_sec_check"
	WeixinGetTokenURI      = "https://api.weixin.qq.com/cgi-bin/token"

	// img suffix
	ImgSuffix = ".jpg"

	// img prefix
	ImgForumpostImgType = 1
	ImgCommentImgType   = 2
	ImgReplyImgType     = 3
	ImgFeedbackImgType  = 4

	ImgPrefixForumpostImg      = "forumpost/forumpost/"
	ImgPrefixMicroForumpostImg = "forumpost/forumpost/micro/"
	ImgPrefixCommentImg        = "forumpost/comment/"
	ImgPrefixMicroCommentImg   = "forumpost/comment/micro/"
	ImgPrefixReplyImg          = "forumpost/reply/"
	ImgPrefixMicroReplyImg     = "forumpost/reply/micro/"
	ImgPrefixFeedbackImg       = "forumpost/feedback/"
	ImgPrefixMicroFeedbackImg  = "forumpost/feedback/micro/"

	// 图片做缩略处理：w: 160, h: 160
	ImgOps       = "imageView2/2/w/160/h/160"
	ImgURIPrefix = "http://image.forumpost.dev.hust.online/"
	ImgMicroSize = 160

	/****************************************** token ****************************************/
	TokenQiniuExpire = 7200
	// JWT
	JWTContextKey = "user"

	//消息通知
	MessageForumpostReply = 11
	MessageForumpostStar  = 12
	MessageCommentReply   = 14
	MessageCommentStar    = 15
	MessageReplyReply     = 18
)

var (
	ErrorIDFormatWrong = errors.New("id format is wrong")
	ErrorNotFound      = errors.New("not found")
	ErrorHasExist      = errors.New("has exist")
	ErrorMismatch      = errors.New("Not match")

	ImgPrefix = map[int]string{
		ImgForumpostImgType: ImgPrefixForumpostImg,
		ImgCommentImgType:   ImgPrefixCommentImg,
		ImgReplyImgType:     ImgPrefixReplyImg,
		ImgFeedbackImgType:  ImgPrefixFeedbackImg,
	}
	ImgPrefixMicro = map[int]string{
		ImgForumpostImgType: ImgPrefixMicroForumpostImg,
		ImgCommentImgType:   ImgPrefixMicroCommentImg,
		ImgReplyImgType:     ImgPrefixMicroReplyImg,
		ImgFeedbackImgType:  ImgPrefixMicroFeedbackImg,
	}

	TagsScore = map[int]int{
		1: TagScoreOne,
		2: TagScoreTwo,
		3: TagScoreThree,
		4: TagScoreFour,
		5: TagScoreFive,
		6: TagScoreSix,
	}
	School = map[int]string{
		1:  "机械科学与工程学院",
		2:  "计算机科学与技术学院",
		3:  "网络空间安全学院",
		4:  "生命科学与技术学院",
		5:  "电气与电子工程学院",
		6:  "材料科学与工程学院",
		7:  "船舶与海洋工程学院",
		8:  "能源与动力工程学院",
		9:  "人工智能与自动化学院",
		10: "光学与电子信息学院",
		11: "水电与数字化工程学院",
		12: "软件学院",
		13: "环境科学与工程学院",
		14: "电子信息与通信学院",
		15: "建筑与城市规划学院",
		16: "土木工程与力学学院",
		17: "化学与化工学院",
		18: "数学与统计学院",
		19: "物理学院",
		20: "公共管理学院",
		21: "经济学院",
		22: "管理学院",
		23: "人文学院",
		24: "新闻与信息传播学院",
		25: "马克思主义学院",
		26: "社会学院",
		27: "法学院",
		28: "外国语学院",
		29: "基础医学院",
		30: "药学院",
		31: "医药卫生管理学院",
		32: "公共卫生学院",
		33: "法医学系",
		34: "护理学院",
		35: "计划生育研究所",
		36: "第一临床学院",
		37: "第二临床学院",
		38: "第三临床学院",
		39: "远程与继续教育学院",
		40: "教育科学研究院",
		41: "中欧清洁与可再生能源学院",
		42: "体育学院",
		43: "武汉光电国家实验室（筹）",
		44: "工程科学学院（国际化示范学院）",
		45: "武汉国际微电子学院",
		46: "航空航天学院",
	}

	Grade = map[int]string{
		1:  "本科16",
		2:  "本科17",
		3:  "本科18",
		4:  "本科19",
		5:  "本科20",
		30: "研一",
		31: "研二",
		32: "研三",
		33: "博一",
		34: "博二",
		35: "博三",
		0:  "已毕业",
	}
)
